Enhance MCP Documentation and Integration#436
Conversation
- Updated `mint.json` to include additional MCP pages for improved navigation. - Added new documentation files for various MCP integrations, including AWS KB Retrieval, Everart, Filesystem, Google Drive, GitHub, GitLab, Google Maps, Memory, PostgreSQL, Puppeteer, Redis, Sequential Thinking, Slack, and Stock Price. - Introduced example scripts for each MCP integration to facilitate user understanding and implementation. - Ensured consistency in documentation format and clarity in instructions for setting up and using MCP tools.
|
Caution Review failedThe pull request is closed. WalkthroughThe changes primarily introduce extensive new documentation and examples for various MCP integrations within PraisonAI agents. Documentation files now cover integrations with AWS KB Retrieval, Brave Search, Everart, Filesystem, Google Drive, GitHub, GitLab, Google Maps, Memory, PostgreSQL, Puppeteer, Redis, Sequential Thinking, Slack, and Stockprice, along with guides for creating custom Python MCP clients and servers. Several existing docs have been updated for clarity and consistency, and the MCP pages listing has been expanded. Additionally, new example scripts demonstrate agent initialization and control flow, while a core file now strictly relies on environment-defined API keys. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant A as AI Agent
participant M as MCP Tool
participant S as External Service
U->>A: Submit query/instructions
A->>M: Initialize tool with configs & env variables
M->>S: Send request to perform action
S-->>M: Return response/data
M-->>A: Relay result
A-->>U: Deliver final output
Poem
π Recent review detailsConfiguration used: CodeRabbit UI π Files selected for processing (37)
β¨ Finishing Touches
πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Hello @MervinPraison, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request enhances the documentation and integration of the Model Context Protocol (MCP) within the PraisonAI agents framework. It introduces new documentation files and example scripts for various MCP integrations, including AWS KB Retrieval, Everart, Filesystem, Google Drive, GitHub, GitLab, Google Maps, Memory, PostgreSQL, Puppeteer, Redis, Sequential Thinking, and Slack. The mint.json file is updated to include these new MCP pages for improved navigation. The documentation aims to provide clear instructions and examples for setting up and using MCP tools with PraisonAI agents.
Highlights
- Documentation Enhancement: Added comprehensive documentation for various MCP integrations, providing users with clear setup and usage instructions.
- New MCP Integrations: Introduced documentation and examples for AWS KB Retrieval, Everart, Filesystem, Google Drive, GitHub, GitLab, Google Maps, Memory, PostgreSQL, Puppeteer, Redis, Sequential Thinking, and Slack MCP integrations.
- Example Scripts: Included example scripts for each MCP integration to facilitate user understanding and implementation.
- Updated Navigation: Updated
mint.jsonto include the new MCP pages, improving overall documentation navigation.
Changelog
Click here to see the changelog
- docs/mcp/aws-kb-retrieval.mdx
- Created a new documentation file for AWS KB Retrieval MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting API keys, creating a Python file, and running the agent.
- Added a note outlining the requirements for using the integration.
- docs/mcp/bravesearch.mdx
- Modified the Brave Search MCP integration documentation.
- Updated the diagram to reflect the query flow.
- Added an install dependencies step to the quick start guide.
- Removed the features section.
- docs/mcp/custom-python-client.mdx
- Created a new documentation file for a Custom Python MCP Client.
- Included a diagram illustrating the client-server interaction.
- Provided a quick start guide with steps for installing dependencies, setting up the server, creating the client, and running the client.
- Added a note outlining the requirements for using the integration.
- Added a section on using environment variables for better security and flexibility.
- docs/mcp/custom-python-server.mdx
- Created a new documentation file for a Custom Python MCP Server.
- Included a diagram illustrating the client-server interaction.
- Provided a quick start guide with steps for installing dependencies and saving the server code.
- Added a note outlining the requirements for using the server.
- docs/mcp/custom.mdx
- Modified the custom MCP documentation.
- Removed conda environment creation steps and updated dependency installation.
- Simplified the agent execution command.
- docs/mcp/everart.mdx
- Created a new documentation file for Everart MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting API keys, creating a Python file, and running the agent.
- Added a note outlining the requirements for using the integration.
- docs/mcp/filesystem.mdx
- Created a new documentation file for Filesystem MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting API keys, creating a Python file, and running the agent.
- Added a note outlining the requirements for using the integration.
- docs/mcp/gdrive.mdx
- Created a new documentation file for Google Drive MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting up Google Drive credentials, creating a Python file, and running the agent.
- Added a note outlining the requirements for using the integration.
- docs/mcp/github.mdx
- Created a new documentation file for GitHub MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting API keys, creating a Python file, and running the agent.
- Added a note outlining the requirements for using the integration.
- docs/mcp/gitlab.mdx
- Created a new documentation file for GitLab MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting API keys, creating a Python file, and running the agent.
- Added a note outlining the requirements for using the integration.
- docs/mcp/google-maps.mdx
- Created a new documentation file for Google Maps MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting API keys, creating a Python file, and running the agent.
- Added a note outlining the requirements for using the integration.
- docs/mcp/memory.mdx
- Created a new documentation file for Memory MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting API keys, creating a Python file, and running the agent.
- Added a note outlining the requirements for using the integration.
- docs/mcp/postgres.mdx
- Created a new documentation file for PostgreSQL MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting up PostgreSQL, creating a Python file, and running the agent.
- Added a note outlining the requirements for using the integration.
- docs/mcp/puppeteer.mdx
- Created a new documentation file for Puppeteer MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting API keys, creating a Python file, and running the agent.
- Added a note outlining the requirements for using the integration.
- docs/mcp/redis.mdx
- Created a new documentation file for Redis MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting up Redis, creating a Python file, and running the agent.
- Added a note outlining the requirements for using the integration.
- docs/mcp/sequential-thinking.mdx
- Created a new documentation file for Sequential Thinking MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting API keys, creating a Python file, and running the agent.
- Added a note outlining the requirements for using the integration.
- docs/mcp/slack.mdx
- Created a new documentation file for Slack MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting API keys, creating a Python file, and running the agent.
- Added a note outlining the requirements for using the integration.
- docs/mcp/stockprice.mdx
- Created a new documentation file for Stock Price MCP integration.
- Included a diagram illustrating the integration flow.
- Provided a quick start guide with steps for installing dependencies, setting API keys, creating the MCP server, creating the agent, and running the agent.
- Added a note outlining the requirements for using the integration.
- Added a Gradio UI example.
- docs/mint.json
- Updated the
mint.jsonfile to include the new MCP documentation pages.
- Updated the
- examples/mcp/airbnb-mcp.py
- Added an example script for Airbnb MCP integration.
- examples/mcp/aws-kb-retrieval-mcp.py
- Added an example script for AWS KB Retrieval MCP integration.
- examples/mcp/bravesearch-mcp.py
- Added an example script for Brave Search MCP integration.
- examples/mcp/custom-python-client.py
- Added an example script for Custom Python MCP Client.
- examples/mcp/custom-python-server.py
- Added an example script for Custom Python MCP Server.
- examples/mcp/everart-mcp.py
- Added an example script for Everart MCP integration.
- examples/mcp/filesystem-mcp.py
- Added an example script for Filesystem MCP integration.
- examples/mcp/gdrive-mcp.py
- Added an example script for Google Drive MCP integration.
- examples/mcp/github-mcp.py
- Added an example script for GitHub MCP integration.
- examples/mcp/gitlab-mcp.py
- Added an example script for GitLab MCP integration.
- examples/mcp/google-maps-mcp.py
- Added an example script for Google Maps MCP integration.
- examples/mcp/memory-mcp.py
- Added an example script for Memory MCP integration.
- examples/mcp/postgres-mcp.py
- Added an example script for PostgreSQL MCP integration.
- examples/mcp/puppeteer-mcp.py
- Added an example script for Puppeteer MCP integration.
- examples/mcp/redis-mcp.py
- Added an example script for Redis MCP integration.
- examples/mcp/sequential-thinking-mcp.py
- Added an example script for Sequential Thinking MCP integration.
- examples/mcp/slack-mcp.py
- Added an example script for Slack MCP integration.
- src/praisonai-agents/mcp-mini-bravesearch.py
- Removed default Brave API key.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with π and π on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Trivia time!
What does the acronym 'API' stand for in the context of software development?
Click here for the answer
'API' stands for Application Programming Interface.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. β©
There was a problem hiding this comment.
Code Review
This pull request enhances the documentation and integration of MCP (Model Context Protocol) by adding new documentation files and example scripts for various MCP integrations. The addition of these guides and examples should help users understand and implement MCP tools more effectively. The documentation covers a wide range of integrations, including AWS, Google Drive, GitHub, and more.
Summary of Findings
- Inconsistent Dependency Installation Instructions: The documentation for some MCP integrations instructs users to install
praisonaiagentsandmcpusing pip, while others instruct users to create a conda environment and install dependencies there. This inconsistency could confuse users and lead to errors. - Hardcoded Paths in Custom Python Client Example: The
custom-python-client.mdxfile includes hardcoded paths for the Python interpreter and server script. This makes the example less portable and requires users to manually update the paths to match their local environment. - Missing Error Handling in Example Scripts: The example scripts provided in the documentation lack comprehensive error handling. This could make it difficult for users to debug issues and understand how to handle potential errors in their own implementations.
- Incomplete Documentation for Custom Python MCP Server: The
custom-python-server.mdxfile is missing the actual code implementation for the custom Python MCP server, which is essential for users to understand and set up the server correctly.
Merge Readiness
While the pull request introduces valuable documentation and examples for MCP integrations, several issues need to be addressed before merging. Specifically, the inconsistent dependency installation instructions, hardcoded paths in the custom Python client example, missing error handling in example scripts, and incomplete documentation for the custom Python MCP server should be resolved to ensure a smooth user experience. I am unable to approve this pull request, and recommend that it not be merged until these issues are addressed.
| ## Server Implementation | ||
|
|
||
| Below is the complete implementation of the custom Python MCP server: | ||
|
|
There was a problem hiding this comment.
The section "Server Implementation" is followed by "Below is the complete implementation of the custom Python MCP server:", but the actual code is missing here. Please include the code snippet for the server implementation.
import yfinance as yf
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("stock_prices")
@mcp.tool()
async def get_stock_price(ticker: str) -> str:
"""Get the current stock price for a given ticker symbol.
Args:
ticker: Stock ticker symbol (e.g., AAPL, MSFT, GOOG)
Returns:
Current stock price as a string
"""
if not ticker:
return "No ticker provided"
try:
stock = yf.Ticker(ticker)
info = stock.info
current_price = info.get('currentPrice') or info.get('regularMarketPrice')
if not current_price:
return f"Could not retrieve price for {ticker}"
return f"${current_price:.2f}"
except Exception as e:
return f"Error: {str(e)}"
if __name__ == "__main__":
mcp.run(transport='stdio')
| # Use the API key from environment or set it directly | ||
| brave_api_key = os.getenv("BRAVE_API_KEY") or "BSAbRwmwE-WV_7gKR1ZZIdE2Twa0l4w" | ||
| brave_api_key = os.getenv("BRAVE_API_KEY") |
There was a problem hiding this comment.
Removing the default API key is a good security practice. Ensure that the application handles the case where the BRAVE_API_KEY environment variable is not set, providing a helpful error message or fallback mechanism.
| # Use the API key from environment or set it directly | |
| brave_api_key = os.getenv("BRAVE_API_KEY") or "BSAbRwmwE-WV_7gKR1ZZIdE2Twa0l4w" | |
| brave_api_key = os.getenv("BRAVE_API_KEY") | |
| brave_api_key = os.getenv("BRAVE_API_KEY") | |
| if not brave_api_key: | |
| raise ValueError("BRAVE_API_KEY environment variable must be set.") |
| tools = MCP("/Users/praison/miniconda3/envs/mcp/bin/python /Users/praison/stockprice/custom-python-server.py") | ||
| ) |
There was a problem hiding this comment.
This line contains a hardcoded path to the Python interpreter and the custom server script. This makes the example less portable. Suggest using environment variables or a more flexible path configuration.
tools = MCP(f"{os.getenv('PYTHON_PATH', '/path/to/python')} {os.getenv('SERVER_PATH', '/path/to/custom-python-server.py')}")
|
|
||
| everart_agent.start("Generate an artistic image of a sunset") No newline at end of file |
There was a problem hiding this comment.
Consider adding error handling to the agent's start method call to catch potential exceptions during the MCP call. This would improve the robustness of the example and guide users on how to handle errors in their own implementations.
| everart_agent.start("Generate an artistic image of a sunset") | |
| try: | |
| everart_agent.start("Generate an artistic image of a sunset") | |
| except Exception as e: | |
| print(f"Error: {e}") |
|
|
||
| gdrive_agent.start("List files in my Google Drive") No newline at end of file |
There was a problem hiding this comment.
Consider adding error handling to the agent's start method call to catch potential exceptions during the MCP call. This would improve the robustness of the example and guide users on how to handle errors in their own implementations.
| gdrive_agent.start("List files in my Google Drive") | |
| try: | |
| gdrive_agent.start("List files in my Google Drive") | |
| except Exception as e: | |
| print(f"Error: {e}") |
|
|
||
| puppeteer_agent.start("Navigate to example.com and take a screenshot") No newline at end of file |
There was a problem hiding this comment.
Consider adding error handling to the agent's start method call to catch potential exceptions during the MCP call. This would improve the robustness of the example and guide users on how to handle errors in their own implementations.
| puppeteer_agent.start("Navigate to example.com and take a screenshot") | |
| try: | |
| puppeteer_agent.start("Navigate to example.com and take a screenshot") | |
| except Exception as e: | |
| print(f"Error: {e}") |
|
|
||
| redis_agent.start("Set a key-value pair in Redis") No newline at end of file |
There was a problem hiding this comment.
Consider adding error handling to the agent's start method call to catch potential exceptions during the MCP call. This would improve the robustness of the example and guide users on how to handle errors in their own implementations.
| redis_agent.start("Set a key-value pair in Redis") | |
| try: | |
| redis_agent.start("Set a key-value pair in Redis") | |
| except Exception as e: | |
| print(f"Error: {e}") |
|
|
||
| sequential_agent.start("Break down the process of making a cup of tea") No newline at end of file |
There was a problem hiding this comment.
Consider adding error handling to the agent's start method call to catch potential exceptions during the MCP call. This would improve the robustness of the example and guide users on how to handle errors in their own implementations.
| sequential_agent.start("Break down the process of making a cup of tea") | |
| try: | |
| sequential_agent.start("Break down the process of making a cup of tea") | |
| except Exception as e: | |
| print(f"Error: {e}") |
|
|
||
| slack_agent.start("Send a message to the general channel") No newline at end of file |
There was a problem hiding this comment.
Consider adding error handling to the agent's start method call to catch potential exceptions during the MCP call. This would improve the robustness of the example and guide users on how to handle errors in their own implementations.
| slack_agent.start("Send a message to the general channel") | |
| try: | |
| slack_agent.start("Send a message to the general channel") | |
| except Exception as e: | |
| print(f"Error: {e}") |
| <Step title="Install Dependencies"> | ||
| Make sure you have Node.js installed, as the MCP server requires it: | ||
| ```bash | ||
| pip install praisonaiagents mcp | ||
| ``` |
β Deploy Preview for praisonai ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Enhance MCP Documentation and Integration
mint.jsonto include additional MCP pages for improved navigation.Summary by CodeRabbit
Documentation
New Features
Chores